<template>
	<view>
		<view class="header">
			<view class="assets">
				<text>总资产(元)</text>
				<image style="width: 30rpx;height: 23rpx;" v-show="eyeShow == false" @click="eyeHandle" src="../../../../static/img/personCenter/myWallet/eye.png" mode=""></image>
				<image style="width: 30rpx;height: 30rpx;" v-show="eyeShow == true" @click="eyeHandle" src="../../../../static/img/personCenter/myWallet/isEye.png" mode=""></image>
			</view>
			<view class="money">{{ eyeShow == true ? '*****' : money }}</view>
		</view>
		<view class="container">
			<view class="select" @click="onNavigateTo('/pages/tabbar/personCenter/myWallet/recharge')">
				<view class="select_left">
					<image style="width: 34rpx;height: 34rpx;" src="../../../../static/img/personCenter/myWallet/recharge.png" mode=""></image>
					<text>充值</text>
				</view>
				<view class="select_right">
					<text class="select_right_text">充值有礼</text>
					<text class="iconfont">&#xe79a;</text>
				</view>
			</view>
			<view class="select" @click="onNavigateTo('/pages/tabbar/personCenter/myWallet/record')">
				<view class="select_left">
					<image style="width: 29rpx;height: 34rpx;" src="../../../../static/img/personCenter/myWallet/record.png" mode=""></image>
					<text>充值明细</text>
				</view>
				<view class="select_right">
					<text class="iconfont">&#xe79a;</text>
				</view>
			</view>
			<view class="select" @click="onNavigateTo('/pages/tabbar/personCenter/myWallet/setting')">
				<view class="select_left">
					<image style="width: 34rpx;height: 37rpx;" src="../../../../static/img/personCenter/myWallet/setting.png" mode=""></image>
					<text>使用记录</text>
				</view>
				<view class="select_right">
					<text class="iconfont">&#xe79a;</text>
				</view>
			</view>
			<view class="select" @click="onNavigateTo('/pages/tabbar/personCenter/myWallet/discount')">
				<view class="select_left">
					<image style="width: 33rpx;height: 34rpx;" src="../../../../static/img/personCenter/myWallet/discount.png" mode=""></image>
					<text>优惠券</text>
				</view>
				<view class="select_right">
					<text class="select_right_text">{{user.couponcount}}</text>
					<text class="iconfont">&#xe79a;</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import url from '@/tool/index.js';
import { index } from '@/api/user/userCenter/userCenter.js';
import { myWallet } from '@/api/user/userCenter/myWallet/myWallet.js';
export default {
	data() {
		return {
			serverUrl: '',
			eyeShow: false,
			money:'',
			user:{
				balance:'',
				couponcount:0
			}
		};
	},
	async onShow() {
		let res=await myWallet()
		// console.log(res);
		this.user=res.data
		let data=await index()
		this.money=data.data.user.money
	},
	methods: {
		eyeHandle() {
			if (this.eyeShow) {
				this.eyeShow = false;
			} else {
				this.eyeShow = true;
			}
		},
		onNavigateTo(url) {
			uni.navigateTo({
				url: url
			});
		}
	}
};
</script>

<style lang="scss">
@import './css/myWallet.scss';
</style>
